package plug_in_javafx_dt.wizards;

import java.net.URI;
import java.net.URISyntaxException;

import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

import plug_in_javafx_dt.launching.JFXClasspathContainerInitializer;
import plug_in_javafx_dt.projectnature.JFXProjectSupport;

public class JFXWizard extends Wizard implements INewWizard {

	private JFXWizardPage page;
	public JFXWizard() {
		setWindowTitle("New JavaFX Project");
	}

	@Override
	public void addPages() {
		page = new JFXWizardPage();
		addPage(page);
	}
	
	@Override
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		

	}

	@Override
	public boolean performFinish() {
		URI location = null;
		String projectName = page.getProjectName();
		String url = page.getLocation();
		try{
			if(url != ""){				
				location = new URI(url);
			}
			
		}catch (URISyntaxException e) {
			e.printStackTrace();
		}

		
		JFXClasspathContainerInitializer i = new JFXClasspathContainerInitializer();
		//i.initialize("", new JavaP);
		
		
		return true;
	}

}
